package com.gigalaxy.flex.components
{
	import spark.components.DateSpinner;

	public class GGDateSpinner extends DateSpinner
	{
		public function GGDateSpinner()
		{
			super();

			setStyle('locale', 'vi-VN');
			minDate = new Date();
			maxDate = new Date(2036, 3, 6, 13, 5, 19, 88);
		}

		public function toStringExt(format:String = ""):String
		{
			var res:String = "";

			var date:String = "";

			if (selectedDate.date < 10)
			{
				date += "0";
			}

			date += selectedDate.date.toString();

			var month:String = "";

			if (selectedDate.month < 9)
			{
				month += "0";
			}

			month += (selectedDate.month + 1).toString();

			res = date + format + month + format + selectedDate.fullYear.toString();


			return res;
		}
	}
}
